package com.ar4j.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Defines custom property names for the parameters of a dynamic method dynamic method (findBy, findAllBy, countBy, etc.) on an ActiveRecord.
 */
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DynamicMethod {

  /**
   * <code>
   *   {@literal @}DynamicMethod({ "prop1", "prop2" })<br/>
   *   public SomeBean findByMyStuff(String value1, String value2)<br/>
   * </code><br/>
   * 
   * In the above example a finder is run on SomeBean searching where prop1=value1 and prop2=value2. The name of the method
   * itself is not scanned.
   * 
   * @return the names of the properties that are parameters to the method, in the order they appear in the method definition
   */
  String[] value() default { };
  
}
